package PrimeFactors;

import java.util.ArrayList;
import java.util.Scanner;

/**
 * Created by Msp on 24/04/14.
 */
public class PrimeFactors {

    public static ArrayList<Integer> primeFactors;

    public static void main(String[] args) {
        primeFactors = new ArrayList<Integer>();
        int n = 0;
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        findFactors(n);
        printList();
    }

    private static void findFactors(int n) {
        for (int i = 2; i <= n/2; i++) {
            if( (n % i == 0) && ( isPrime(i) ) ){
                primeFactors.add(new Integer(i));
            }
        }
    }

    private static boolean isPrime(int n) {
        for(Integer i : primeFactors){
            if(n % i == 0){
                return false;
            }
        }
        return true;
    }

    private static void printList() {
        for (Integer i : primeFactors){
            System.out.print(i.intValue() + " ");
        }
    }
}
